So upsampling increases the implicit sampling
rate of a signal by creating new output samples
for each input sample. The converse operation
is called downsampling, and it reduces the implicit
sampling rate by keeping only one output sample out
of capital N input samples, or alternatively, by discarding n minus one input samples
every N input samples. The fact that we're discarding samples should raise
all sorts of alarms and indeed we have to be
careful when we use downsampling because
downsampling is affected by a
discrete time version of the alleys in phenomenon
as we will see shortly. Upsampling by contrast is a harmless operation
because it only adds the samples which can be removed later on if necessary. Formerly, a downsampled sequence
is obtained simply by retaining one sample out
of capital N samples. The symbol for the downsampling
operator is a circle with the downsampling factor and
an arrow pointing downwards. Graphically, if you
have a signal like so, and we downsample it by four, what we do is we retain
only one sample out of four. So the orange samples
here will be the survivors and
the resulting signal will be the following. As you can see, there's a significant loss of
information and we have to make sure that this loss of information is not irreversible. The spectral representation of a downsampled sequence is a little bit trickier to derive than in the case of upsampling. Like before, we start with the z transform of the downsampled sequence
and the expression for the z transform is now
the sum for k that goes from minus infinity to plus infinity
of the surviving samples. So x of k capital N
times z to the minus k. This expression is not really easy to take apart as is. So here comes the first trick. Consider an auxiliary
z transform, A of z which is the sum
for all values of k of x of k times capital
N like before. But now, you multiply this
by z to the minus k times capital N. If we knew
the z transform A of z, then the z transform of the downsampled sequence
would be just A computed in z to the power of
one over capital N. Then when we bring this to
the unit circle like before, we would have an expansion
of the frequency axis by a factor of N before
we had the contraction. So now the question is, how do we find the value of A of z? So here comes the second trick. A of z as we saw is the sum
of x of kN times z_kN. So you see that
all the indices here are multiplied by capital N.
So we're hopping over multiples of capital N.
We can rewrite this as the z transform of the
original sequence x of k times an auxiliary sequence
Xi of k that is used to kill all terms in
the sum where k is not a multiple of capital N. So Xi of N is an indicator
sequence that only selects samples whose index is a multiple of capital
N. As an example, here's the graphical
representation of Xi of n for capital N equal to four. You will have one sample
that is equal to one followed by three zeros
samples and so on so forth. Now here comes the third trick. We can remember the formula for the orthogonality of
the roots of unity and we can express Xi of n as the sum for n that goes from zero to
capital N minus 1 of e_j 2Pi over capital
N times m times n normalized by
capital N. With this, we're ready to compute
the expression for A of z. Because now A of z is
the standard z transform of the product between
Xi of n and x of n. So we replace in the expression for the
z transform the value of Xi of n using the roots of unity and we have
a double summation. The external summation is
over these first terms and the z transform will be computed for the original sequence, and we collect
the exponents and we bring this phase term here
together with z to obtain one over n that multiplies the sum of capital N copies of the original z-transform
of the input sequence computed for different
phase of sets of z. So we're taking z, we're multiplying this by
pure phase factor, and computing z transform and then summing all these
copies together. So A of z, we're
just an intermediate quantity that we needed to compute
the actual z transform of a downsample sequence as
A of z computed in z to the power 1 over n. So the expression for
the z-transform is this one, but we're more interested in the restriction of
the z-transform to the unit circle
because that gives us the spectrum of
the downsampled sequence. The expression for
that is the following. There's one over N
normalization factor in front, that multiplies the sum of capital N copies of
the original spectrum, where each copy has
been shifted by a multiple of 2Pi over capital N, and where the frequency axis
has been stretched out by a factor of capital
N. So the interval minus Pi over capital N Pi over N becomes
the interval minus Pi, Pi. Let's look at
a graphical example, where we're downsampling by two. On the top panel, we have the original spectrum
of the input sequence. In the middle panel, we
will compute the auxiliary z transform A of z restricted
to the unit circle. So remember, this will
contain two terms, two shifted copies of
the same spectrum, one shifted by
2Pi over 2 times zero. So it will be centered at zero and this is the original copy. Then you will have
another copy centering 2Pi over 2 times 2,
which is equal to Pi. So here's the second copy of the original spectrum
shifted by Pi. Note that like before,
in the second panel, we're showing the spectrum
with explicit 2Pi periodicity. So we're using a larger support,
the minus Pi, Pi. Finally, we have this expansion
of the frequency axis, where the minus Pi over 2 to Pi over 2 interval will
be mapped to minus Pi, Pi, and so this is
the resulting spectrum. So we have started with
the spectrum that was half band, and because the spectrum
was half band, we had the sufficient gap
in the periodic replica of the spectrum to fit
another copy of the spectrum without overlap
and without aliasing. So this downsampling by
two operation actually does not result in
irreversible loss of information because we have enough room between
non-zero parts of the spectrum to fit
another copy of the spectrum in their snugly
without overlap, which actually means that
the original sequence had been sampled at
the sampling frequency which was at least twice
the minimum sampling frequency stipulated by
the sampling theorem. So by downsampling it, we're bringing it back implicitly to the
critical sampling rate. Let's see what happens
when this is not the case. This is for instance, a spectrum that goes over 2-3 Pi over 4. So when we build
this intermediate quantity A of z restricted
to a unit circle, we have one copy
centered in zero. We'll still downsampling by two. So there will be a second copy
and now centered in pi, and of course, this will overlap with the previous copy
of the spectrum. The sum of the two will be like so indicated
by the red line, and then the remapping or the stretching of
the frequency axis will result in a spectrum for the downsampled sequence
that is like so. So you see here this parts and these parts are
affected by aliasing. What we can do in
discrete time like we did in continuous time is
prevent aliasing by first filtering the original
signal so that its spectral occupancy is small enough so that there will be no overlapping
between the copies, and it's very easy to see that, for instance, in the case
of downsampling by two, what we require of
the signal is to be band-limited indiscreet
time to Pi over 2. So what we can use is an ideal low-pass filter
with cut off Pi over two. This will remove of course
some information here, but in a controlled
fashion so that we're not victims of aliasing, but simply of a trade-off to
reduce the sampling rate. With this filtering operation, now the overlap will not occur, and the copies will sit
neatly side-by-side, and finally,
the resulting spectrum of the downsample sequence
will look like so. In general to avoid aliasing, we have to filter
the input sequence with a low-pass filter with cutoff frequency Pi
over capital N, where N is the down-sampling
factor that will follow. Downsampling and
upsampling changed the implicit sampling rate
by an integer factor, but we can combine them so that the resulting sampling
rate change will be an arbitrary
fractional number. The combination always goes in the sense that we first
upsample the signal, which is the operation
that does not change the information content of the original sequence and
then we perform downsampling. In doing so, we can
combine the filters associated to the
interpolation for upsampling. So if we have an upsampler, followed by an interpolating
low-pass filter, we know that this
lowpass filter will be a low-pass with cutoff
frequency Pi over N, and then the downsampler
will be preceded by an anti-aliasing filter with low-pass cut off
frequency Pi over M. So we can combine
these two filters because they would
act as a cascade, and since they're both
low-pass filters, the smallest cutoff
frequency will win, and so we will just use a simple low-pass filter
where the cutoff frequencies, the minimum between
Pi over N and Pi over M. A practical example that requires a rational
sampling rate change is the conversion format between
the DVD audio and CD audio. In compact discs, the nominal sampling frequency
is 44.1 kilohertz, whereas in DVD audio, the nominal sampling frequency
is 48 kilohertz. If we take the ratio of these two sampling frequencies
and simplify the fraction, we get a ratio of 160 over 147. These are rather
large co-prime terms and they are so biodesign. The reason is DVD audio follows the specification of
an earlier standard for digital audio tapes. Digital audio tapes were
the first consumer device that allowed people to make perfect digital copies
of a medium. So you could go from tape to tape without loss of quality. If the sampling rate
of digital audio tapes had been the same as that of CDs, people could have made
exactly digital copies of CDs and the industry was
obviously afraid of this. So a decision was made to make the sampling frequency of digital audio tapes
close to that of CDs, but sufficiently
inconvenient so that you could not do a direct copy
and you could not use a simple
sample rate conversion to move from one standard
to the other. But as we will see
in the next module, there are clever ways
to circumvent this limitation and
change from CD to DVD sampling rates without using externally high rate of upsamplers and downsamplers.